1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.glibconfig; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.gdataset; 33 import derelict.glib.gslist; 34 import core.stdc.config; 35 36 extern (C): 37 38 alias wchar gint8; 39 alias ubyte guint8; 40 alias short gint16; 41 alias ushort guint16; 42 alias int gint32; 43 alias uint guint32; 44 alias c_long gint64; 45 alias c_ulong guint64; 46 alias c_long gssize; 47 alias c_ulong gsize; 48 alias c_long goffset; 49 alias c_long gintptr; 50 alias c_ulong guintptr; 51 alias int GPid; 52 53 // Normally in gobject 54 55 alias int GType; 56 57 alias _GObject GObject; 58 struct _GObject 59 { 60 GTypeInstance g_type_instance; 61 guint ref_count; 62 GData* qdata; 63 } 64 65 alias _GTypeInstance GTypeInstance; 66 struct _GTypeInstance 67 { 68 GTypeClass* g_class; 69 } 70 71 alias _GParamSpec GParamSpec; 72 struct _GParamSpec 73 { 74 GTypeInstance g_type_instance; 75 const(gchar)* name; 76 GParamFlags flags; 77 GType value_type; 78 GType owner_type; 79 gchar* _nick; 80 gchar* _blurb; 81 GData* qdata; 82 guint ref_count; 83 guint param_id; 84 } 85 86 alias _GParamFlags GParamFlags; 87 enum _GParamFlags 88 { 89 G_PARAM_READABLE = 1, 90 G_PARAM_WRITABLE = 2, 91 G_PARAM_CONSTRUCT = 4, 92 G_PARAM_CONSTRUCT_ONLY = 8, 93 G_PARAM_LAX_VALIDATION = 16, 94 G_PARAM_STATIC_NAME = 32, 95 G_PARAM_PRIVATE = 32, 96 G_PARAM_STATIC_NICK = 64, 97 G_PARAM_STATIC_BLURB = 128, 98 G_PARAM_DEPRECATED = -2147483648 99 } 100 101 alias _GTypeClass GTypeClass; 102 struct _GTypeClass 103 { 104 GType g_type; 105 } 106 107 alias _GObjectClass GObjectClass; 108 struct _GObjectClass 109 { 110 GTypeClass g_type_class; 111 GSList* construct_properties; 112 GObject* function (GType, guint, GObjectConstructParam*) constructor; 113 void function (GObject*, guint, const(GValue)*, GParamSpec*) set_property; 114 void function (GObject*, guint, GValue*, GParamSpec*) get_property; 115 void function (GObject*) dispose; 116 void function (GObject*) finalize; 117 void function (GObject*, guint, GParamSpec**) dispatch_properties_changed; 118 void function (GObject*, GParamSpec*) notify; 119 void function (GObject*) constructed; 120 gsize flags; 121 gpointer[6] pdummy; 122 } 123 124 alias _GObjectConstructParam GObjectConstructParam; 125 struct _GObjectConstructParam 126 { 127 GParamSpec* pspec; 128 GValue* value; 129 } 130 131 alias _GValue GValue; 132 struct _GValue { 133 }; 134 135 alias _GClosure GClosure; 136 struct _GClosure { 137 guint in_marshal; 138 guint is_invalid; 139 }; 140 141 alias _GParameter GParameter; 142 struct _GParameter { 143 const gchar *name; 144 GValue value; 145 }; 146 147 alias void function() GCallback;